<?php if (!defined('THINK_PATH')) exit();?>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>116lyw</title>

    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico"> <link href="/Public/hadmin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/Public/hadmin/css/font-awesome.css?v=4.4.0" rel="stylesheet">

    <link href="/Public/hadmin/css/animate.css" rel="stylesheet">
    <link href="/Public/hadmin/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="/Public/hadmin/css/pclist.css" rel="stylesheet">


</head>

<body class="">
    <div class="row">
         <div class="col-sm-12 "> 
             <div class="pc-log col-sm-2 ">
                 <img style="width:225px;height:66px" src="/Public/file/<?php echo ($system[pclogo]); ?>" class="pc-log-img"> </img>
            </div>
            <div class="col-sm-1"></div>
             <div class="col-sm-6">
                <div class="col-sm-12 pc-top">
                    <div class="input-group">
                      <input type="text" value="<?php echo ($_GET['keyword']); ?>" id="keyword1" class="form-control search" placeholder="请输入关键词搜索">
                        <span class="input-group-btn">
                        <button class="btn btn-default" type="button" id="beginsearch"><span class="glyphicon glyphicon-search" aria-hidden="true"></span>搜索</button>
                        </span>
                    </div>
                </div>
            </div>
             <div class="col-sm-3">
                <div class="col-sm-12 pc-top">
                  <?php if($_SESSION['用户']): ?>欢迎您，<?php echo ($_SESSION['用户']['username']); ?>！ 
                    <a class="btn btn-default" href="<?php echo U('Home/User/logout', ['device' => 'pc']);?>">注销</a>
                    <?php else: ?>
                    <button class="btn btn-primary " type="button" data-toggle="modal" data-target="#login">登录</button>
                    <button class="btn btn-default " data-toggle="modal" data-target="#register" href="">注册</button><?php endif; ?>
                    <a style="margin-right:-30px;" class="btn btn-info " href="<?php echo U('Shop/Index/register');?>">报名参赛</a>
                </div>
            </div>
         </div>
         <div class="col-sm-12">
          <a href="<?php echo ($system[pcpictureurl]); ?>"> <img src="/Public/file/<?php echo ($system[pcpicture]); ?>" class="pc-theme-img"> </img></a>
         </div>
        <div class="col-sm-2 "></div>
        <div class="col-sm-8 ">
            <div class="wrapper wrapper-content">
                <div class="row">
                <div class="col-sm-12" >
                    <div class="pc-underline">
                    <span class="pc-underline pc-font">
              
                    &nbsp;精选路线&nbsp;
                   
                    </span>
                    
                    </div>
                </div>
                    <div class="col-sm-12" class="gray-bg">
                        
                        <div class="panel panel-default pc-panel-default" >
                            <div class="panel-body pc-panel-filter" >
                             <form class="form-inline pc-form-inline" id="searchf">
                                <div class="form-group pc-filter-form">
                                    <label for="exampleInputName2" class="pc-filter-label" >出发地</label>
                                    <input type="text" value="<?php echo ($_GET['departure']); ?>" class="form-control pc-filter-input search" name="departure" id="exampleInputName2">
                                    <input type="hidden" name="keyword" id="keyword">
                                </div>
                                <div class="form-group pc-filter-form">
                                    <label for="exampleInputName2" class="pc-filter-label">目的地</label>
                                    <input type="text" value="<?php echo ($_GET['destination']); ?>"class="form-control pc-filter-input search" name="destination" id="exampleInputName2">
                                </div>
                                <div class="form-group pc-filter-form">
                                    <label for="exampleInputName2" class="pc-filter-label">天数</label>
                                    <input type="text" value="<?php echo ($_GET['days']); ?>" class="form-control pc-filter-input search" name="days" id="exampleInputName2">
                                </div>
                                <div class="form-group pc-form-price">
                                    <label for="exampleInputName2">价格</label>
                                    <input type="text" value="<?php echo ($_GET['startprice']); ?>" class="pc-filter-price form-control search" id="exampleInputName2" name="startprice">
                                    -
                                    <input type="text" value="<?php echo ($_GET['endprice']); ?>" class="form-control pc-filter-price search" id="exampleInputName2" name="endprice">
                                </div> 
                                <button class="btn btn-primary " type="submit">查询</button>
                                </div>

                            </form>

                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12" class="gray-bg">
                        
                        <div class="row panel panel-default pc-panel-default pc-panel-rank">
                            <div class="panel-body" >
                                <?php if($order == 'name'): if($rank == 'asc'): ?><a style="color:red" href="<?php echo U('pclist',['order'=>'name','rank'=>'desc']);?>">
                                    <?php else: ?> 
                                        <a style="color:red" href="<?php echo U('pclist',['order'=>'name','rank'=>'asc']);?>"><?php endif; ?>
                                    <span><i class="fa fa-sort-<?php echo ($rank); ?>">
                                <?php else: ?>
                                    <a onclick="sort('name')" href="<?php echo U('pclist',['order'=>'name','rank'=>'asc']);?>">
                                    <i class="fa fa-sort"><?php endif; ?>
                                    </i>&nbsp;名称</span></a>
                                
                                <?php if($order == 'funding_price'): if($rank == 'asc'): ?><a  style="color:red" href="<?php echo U('pclist',['order'=>'funding_price','rank'=>'desc']);?>">
                                    <?php else: ?> 
                                        <a  style="color:red" href="<?php echo U('pclist',['order'=>'funding_price','rank'=>'asc']);?>"><?php endif; ?>
                                    <span><i class="fa fa-sort-<?php echo ($rank); ?>">
                                <?php else: ?>
                                    <a href="<?php echo U('pclist',['order'=>'funding_price','rank'=>'asc']);?>">
                                    <i class="fa fa-sort"><?php endif; ?>
                                    </i>&nbsp;价格</span></a>
                                
                                  <?php if($order == 'vote'): if($rank == 'asc'): ?><a  style="color:red" href="<?php echo U('pclist',['order'=>'vote','rank'=>'desc']);?>">
                                    <?php else: ?> 
                                        <a  style="color:red" href="<?php echo U('pclist',['order'=>'vote','rank'=>'asc']);?>"><?php endif; ?>
                                    <span><i class="fa fa-sort-<?php echo ($rank); ?>">
                                <?php else: ?>
                                    <a href="<?php echo U('pclist',['order'=>'vote','rank'=>'asc']);?>">
                                    <i class="fa fa-sort"><?php endif; ?>
                                    </i>&nbsp;投票人数</span></a>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12">
                        <div class="pc-lists">
                        <?php
 foreach($list as $vo){ $fundingType = D('FundingType')->find($vo['funding_type']); $fundingModel = D('Funding'.ucfirst($fundingType['en'])); $fundingSpecify = $fundingModel->where(['principal_id'=>$vo['id']])->find(); $votesNum = D('GameVotes')->where(['funding_id'=>$vo['id']])->count(); $likesNum = D('GameLikes')->where(['funding_id'=>$vo['id']])->count(); $commentssNum = D('GameComments')->where(['funding_id'=>$vo['id']])->count(); if ($fundingType['en'] == "travel") { ?>
                        
                        <div class="pc-list col-sm-4">

                            <a href="javascript:void(0)" onclick='showDetail(<?php echo ($vo["id"]); ?>,0)'><img src="/Public/file/<?php echo ($vo['img']); ?>"> </img></a>
                            <div class="row">
                            <div class="pc-list-info col-sm-12">
                                <a onclick="like(<?php echo ($vo['id']); ?>)" class="button" id="like_<?php echo ($vo['id']); ?>" <?php if($vo['like'] != 0): ?>style="color:red;border-color:red"<?php endif; ?>>
                                <i class="fa fa-thumbs-o-up"><span id="like_num_<?php echo ($vo['id']); ?>"><?php echo ($likesNum); ?><span></i> </a>                     
                                
                                <a onclick="vote(<?php echo ($vo['id']); ?>)" id="vote_<?php echo ($vo['id']); ?>" class="button" <?php if($vo['vote'] != 0): ?>style="color:red;border-color:red"<?php endif; ?>>
                                <i class="fa fa-user"><span id="vote_num_<?php echo ($vo['id']); ?>"><?php echo ($votesNum); ?><span></i> </a>
                          
                                <a href="javascript:void(0)" onclick='showDetail(<?php echo ($vo["id"]); ?>,1)' <?php if($vo['comment'] == 0): ?>style="color:#686a6b;border-color:#686a6b"<?php endif; ?>> 
                                <i class="fa fa-commenting-o"><span><?php echo ($commentssNum); ?><span></i></a> 
                            </div>
                            
                            <div class="pc-list-infos col-sm-12">
                                <a href="javascript:void(0)" onclick='showDetail(<?php echo ($vo["id"]); ?>,0)'>
                                <span>名称：<?php echo ($vo['name']); ?><br></span>
                                <span>目的地：<?php echo ($fundingSpecify['destination']); ?><br></span>
                                <span>行程天数：<?php echo ($fundingSpecify['days']); ?><br></span>
                                <span>预算：￥<?php echo ($vo['funding_price']); ?><br></span>
                                </a>
                               
                            </div>
                            </div>
                        </div>
                        <?php }} ?>
                     </div>
                    </div>
                     <div class="col-sm-12">
                        <div class="pc-lists">
                      <?php echo ($page); ?>
                    </div></div>
                  

                    

            </div>
             <div class="col-sm-2 "></div>
            <div class="footer">
                <div class="contact-us">
                    <small>
                   <?php echo (html_entity_decode($system['contract'] )); ?>
                    </small>
                </div>
            </div>
        </div>
      <!-- 报名参赛模态框（Modal） -->
    <div class="modal fade" id="signup" tabindex="-1" role="dialog" >
    <div class="modal-dialog pc-login-register">
        <div class="modal-content">
            
            <div class="modal-body">
                  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                 <?php echo (html_entity_decode($system['alertdetail'] )); ?>
               
            </div>
        </div>
    </div><!-- /.modal-content -->
    </div><!-- /.modal -->

   <!-- 投票模态框（Modal） -->
    <div class="modal fade" id="votemodal" tabindex="-1" role="dialog" >
    <div class="modal-dialog pc-login-register">
        <div class="modal-content">
            
            <div class="modal-body">
                  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                 <?php echo (html_entity_decode($system['votedetail'] )); ?>
               
            </div>
        </div>
    </div><!-- /.modal-content -->
    </div><!-- /.modal -->

      <!-- 登录模态框（Modal） -->
    <div class="modal fade" id="login" tabindex="-1" role="dialog" >
    <div class="modal-dialog pc-login-register">
        <div class="modal-content">
            
            <div class="modal-body">
                  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <form class="m-t" role="form" action="<?php echo U('Home/User/login',['device'=>'pc']);?>" method="post">
                <div class="form-group">
                    <input type="text" name="username" class="form-control"  placeholder="用户名" required="">
                </div>
                <div class="form-group">
                    <input type="password" name="password" class="form-control" placeholder="密码" required="">
                </div>
                <button type="submit" class="btn btn-primary block full-width m-b">登 录</button>


                <p class="text-muted text-right">  <a href="" data-toggle="modal" data-dismiss="modal" data-target="#register">免费注册</a>
                </p>

            </form>
            </div>
        </div>
    </div><!-- /.modal-content -->
    </div><!-- /.modal -->

    <!-- 注册模态框（Modal） -->
    <div id="register" class="modal fade" >
    <div class="modal-dialog pc-login-register">
        <div class="modal-content">
             <div class="modal-body">
                  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <form class="m-t" role="form" action="<?php echo U('Home/User/register',['device'=>'pc']);?>" method="post">
               
                <div class="form-group">
                     <input type="text" class="form-control" name="username" id="username"  placeholder="请输入手机号" required="">
                </div>
                <div class="form-group form-inline">
               
                     <input type="text" class="form-control"  id="verify-code" name="verify-code" placeholder="请输入验证码" required="">
                   
                    <a id="verify-button" onclick="getVerifyCode();">获取验证码</a>
                </div>
                <div class="form-group">
                    <input type="password" name="password" class="form-control" placeholder="请输入密码" required="">
                </div>
                <div class="form-group">
                    <input type="password" name="repassword" class="form-control" placeholder="请再次输入密码" required="">
                </div>
                <div class="form-group">
                     <input type="text" name="name" class="form-control" placeholder="请输入姓名" required="">
                </div>
                <div class="form-group">
                     <input type="text" name="email" class="form-control" placeholder="请输入邮箱" required="">
                </div>
                <button type="submit" class="btn btn-primary block full-width m-b">注 册</button>

                <p class="text-muted text-center"><small>已经有账户了？</small><a href="" data-toggle="modal" data-dismiss="modal" data-target="#login">点此登录</a>
                </p>

            </form>
            </div>
        </div>
    </div><!-- /.modal-content -->
    </div><!-- /.modal -->

 

      <!-- 详情模态框（Modal） -->
    <div class="modal fade" id="detail" tabindex="-1" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
           <div class="modal-body">
                 
                <div class="row">
                  
                <div class="col-sm-12 "> 
                    <div class="col-sm-12 "> 
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    </div>
                    <div class="col-sm-6"> </div>
                    <div class="col-sm-6 pc-detail-name"> 
                        <h3 id="detail-name"></h3>
                    </div>
                </div>
                <div class="col-sm-12 "> <!-- img-info-->
                    <div class="col-sm-6">  
                        <img id="detail-img" src="/Public/file/<?php echo ($list[0]['img']); ?>" class="pc-detail-img"> </img>
                    </div>
                    <div class="col-sm-6 pc-detail-right">  
                        <div class= "row">
                            <div class="row col-sm-12 "> 
                                <div class="col-sm-6"><h4 id="detail-price">￥</h4> </div>  
                                <div class="col-sm-6"> <a id="detail_vote"><h4><i class="fa fa-user pc-icon"><span id="detail_vote_num" class="pc-text">111<span></i></h4></a></div>
                            </div>
                            <div class="row col-sm-12 "> 
                                <div class="col-sm-6"><h5 id="detail-departure">出发地</h5> </div>  
                                <div class="col-sm-6"><h5 id="detail-destination">目的地</h5></div> 
                            </div>
                            <div class="row col-sm-12 detail-buttons"> 
                                <div class="col-sm-3">
                                    <div class="detail-like-info">  
                                    <a onclick="like(id)" class="button" id="detail_like" <?php if($vo['like'] != 0): ?>style="color:red;border-color:red"<?php endif; ?>>
                                    <i class="fa fa-thumbs-o-up"><span id="detail_like_num"><span></i> 
                                    </a> 
                                    </div>
                                </div>  
                                <div class="col-sm-9">
                                    <div class="detail-vote-signup">  
                                
                                    <button id="detail-vote-button" class="btn btn-primary btn-sm" onclick="vote(id)" href="">投票</button>
                                    <a class="btn btn-primary btn-sm" href="<?php echo U('Shop/Index/register');?>">报名</a> 
                                    <button id="detail-consult" class="btn btn-primary btn-sm" onclick="consult(id)">咨询</button>
                                    </div>
                                </div> 
                            </div>
                        </div>
                    </div>
                </div>  <!-- img-info end-->
                
                <div class="col-sm-12 detail-pc-all"> 
                    <h4>行程介绍</h4>
                    <div id="detail-pc"></div>
                </div> 
             
                
                <div class="col-sm-12 pc-comment">  <!-- comments-begin-->
                    <div class='pc-comment-title'>
                        网友评论
                    </div>

                    <!-- comments-content begin-->
                    <div id="detail-comments">

                    <div id='detail-comment' class='col-sm-12 pc-comment-content'>
                        <div class='row col-sm-2'>
                        <div class="comment-user-photo">
                            <img id="detail-img" src="http://img3.tuniucdn.com/img/20140811/usercenter_lxl/default.gif" class="pc-detail-img"> </img>
                        </div>
                        </div>
                        <div class='col-sm-10'>
                            <div class="comment-content">
                                <span class='comment-username'>username:</span>
                                   comments
                            </div>
                            <div class="comment-footer">
                                <div class="col-sm-8 comment-time">
                                    time
                                </div>
                                <div class="col-sm-4 comment-op">
                                    <a href="#" class='reply'> 回复 </a>
                                    <a href="#" class='report'>举报</a>
                                </div>
                            </div>
                        </div> 
                    </div>

                    </div><!-- comments-content-end-->

                    <div id="comments-page-row"></div>
                    <div class='pc-comment-dialog col-sm-12'><!-- comments-dialog begin-->
                        <h3>发表评论</h3>
                        <div class="dialog-box">
                            <form action="<?php echo U('discuss',['device'=>'pc']);?>" method="post">
                              <textarea id="detail-comment-dialog" 
                                <?php if($_SESSION['用户']): ?>placeholder="请输入您的评论"
                                <?php else: ?>
                                placeholder="请先登录，再进行评论！"<?php endif; ?>
                                rows="5"  name="content"  agtofocus=""></textarea>
                                <input id="detail-id" type="hidden" name="fid" value="">
                                <input id="detail-reply-id" type="hidden" name="replyid" value="0">
                                <?php if($_SESSION['用户']): ?><button type="submit" class="btn btn-primary">&nbsp;&nbsp;提交评论&nbsp;&nbsp;</button><?php endif; ?>
                                </div>
                            </form>
                        </div>
                    </div><!-- comments-dialog-begin-->
                </div><!-- comments-end-->
                
                </div> 
                </div>
                </div>
            </div>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
    </div>
</div>


    <!-- 全局js -->
    <script src="/Public/hadmin/js/jquery.min.js?v=2.1.4"></script>
    <script src="/Public/hadmin/js/bootstrap.min.js?v=3.3.6"></script>



    <!-- 自定义js -->
    <script src="/Public/hadmin/js/content.js?v=1.0.0"></script>


<script>
function signup() {
    $('#detail').modal('hide');
    $('#signup').modal('show');
}

function consult(username) {
    alert("联系电话："+username+"!");
}

function vote (id,type) {
    var mode = "<?php echo ($mode); ?>";
    console.log(mode);
    if (mode == 'vote') {
    $.post("<?php echo U('vote');?>", {fid: id}, function (ret) {
        if (ret.status == 0) {
            if (ret.flag == 1) {
                $("#vote_"+id).attr('style', 'color:red');
                if(type == 1) {
                    alert("投票成功！");
                    $('#detail_vote').css({"color":"red","border-color":"red"});
                }
            } else {
                $("#vote_"+id).attr('style', 'color:#676a6c');
                if(type == 1) {
                    $('#detail_vote').css({"color":"#676a6c","border-color":"#676a6c"});
                }
            }
            $("#vote_num_"+id).html(ret.num);
            if(type == 1) {
                $('#detail_vote_num').html(ret.num);
            }
        } else {
            alert(ret.msg);
            $('#detail').modal('hide');
            $('#login').modal('show');
        }
    }, 'json')
    } else {
       $('#detail').modal('hide');
        $('#votemodal').modal('show');
    }
}

function like (id,type) {
    $.post("<?php echo U('like');?>", {fid: id}, function (ret) {
        if (ret.status == 0) {
            if (ret.flag == 1) {
                $("#like_"+id).attr('style', 'color:red');
                if(type == 1) {
                    $('#detail_like').css({"color":"red","border-color":"red"});
                }
            } else {
                $("#like_"+id).attr('style', 'color:#676a6c');
                if(type == 1) {
                    $('#detail_like').css({"color":"#006621","border-color":"#006621"});
                }
            }
           $("#like_num_"+id).html(ret.num);
           if(type == 1) {
                $('#detail_like_num').html(ret.num);
            }
        } else {
            alert(ret.msg);
            $('#detail').modal('hide');
            $('#login').modal('show');
        }
    }, 'json');
}

function showDetail(id,isComment) {
    $.post("<?php echo U('pcdetail');?>", {id: id}, function (ret) {
        console.log(ret);
        if (ret.status != 0) {
            alert(ret.msg);
        } 
        $('#detail-name').text(ret.funding.name);
        $('#detail-price').text("￥"+ ret.funding.funding_price);
        $('#detail-img').attr("src","/Public/file/"+ret.funding.img);
      
        $('#detail-departure').text("出发地："+ret.funding_specify.departure);
        $('#detail-destination').text("目的地："+ret.funding_specify.destination);
        $('#detail-pc').html(ret.funding.detail_pc);
        $('#detail-pc img').css({'max-width':'520px'});
        $('#detail-id').val(ret.funding.id);
        $('#detail-comment-dialog').val("");
        
        $('#detail_vote_num').text(ret.funding.vote_num);
        if(ret.funding.vote == 1) {
            $('#detail_vote').css({"color":"red","border-color":"red"});
        } else {
            $('#detail_vote').css({"color":"#676a6c","border-color":"#676a6c"});
            
        }
        $('#detail_vote').attr("onclick","vote("+ret.funding.id+",1)")
        $('#detail-vote-button').attr("onclick","vote("+ret.funding.id+",1)")
        $('#detail_like_num').text(ret.funding.like_num)
  
        if(ret.funding.like == 1) {
            $('#detail_like').css({"color":"red","border-color":"red"});
        } else {
            $('#detail_like').css({"color":"#006621","border-color":"#006621"});
           
        }
        $('#detail_like').attr("onclick","like("+ret.funding.id+",1)")

        
        $('#detail-consult').attr("onclick","consult('"+ret.funding.username+"')")
        
        //var imgeWidth = 0.7*$('#detail-img').parent().width();
        //console.log($('#detail-img').width());
        //console.log(imgeWidth);
        //$('#detail-img').css({'height':imgeWidth});
        
        var content="";
        for (var i=0;i<ret.discuss_list.length;i++) {
            if(ret.discuss_list[i].reply != 0) {
                ret.discuss_list[i].content = "@回复"+ret.discuss_list[i].username+"："+ret.discuss_list[i].content;
            }
           
            content=content+
            "<div id='detail-comment' class='col-sm-12 pc-comment-content'><div class='row col-sm-2'><div class='comment-user-photo'><img id='detail-img' src='/Public/file/"+ret.discuss_list[i].photo+"' class='pc-detail-img'> </img></div></div><div class='col-sm-10'><div class='comment-content'><span class='comment-username'>"+ret.discuss_list[i].username +"：</span>"+ret.discuss_list[i].content+"</div><div class='comment-footer'><div class='col-sm-8 comment-time'>"+ret.discuss_list[i].created_at+"</div><div class='col-sm-4 comment-op'><a href='#' onclick='reply("+ret.discuss_list[i].user_id+","+ret.discuss_list[i].username+")' class='reply'> 回复 </a><a href='#' class='report'>举报</a></div></div></div></div><!-- comments-content-end-->"
        }

        if (ret.discuss_list.length==0) {
           $('#detail-comments').html("<br>暂无评论！"); 
        } else{

            
            $('#detail-comments').html(content);
            //$('#comments-page-row').html(ret.page);
        }
        $('#detail').modal('show');
            //keyboard: true
        //});

    }, 'json');
}

var countTime = 60;

function handleTimer(){
        console.log(timer);
        if(curTime==0){
            clearInterval(timer);
            timer=null;
             $("#verify-button").removeClass("disabledA");
            $("#verify-button").text("重新发送验证码");
        }
        else{
            curTime--;
            $("#verify-button").text(curTime+"秒后可重新发送");
        }
}

function getVerifyCode() {
    var phone = $('#username').val();
    var phonereg = /^(((13[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$/; 
    curTime=countTime;
    if(!phonereg.test(phone)) { 
        alert('请输入有效的手机号码！'); 
        return false; 
    } else {
        $.post("/Home/User/sendVerifyCode",{phone:phone},function(result){
            console.log(result);
             alert('验证码发送成功!');
             $("#verify-button").text(curTime+"秒后可重新发送");
             timer=setInterval(handleTimer, 1000);
             $("#verify-button").addClass("disabledA");
        });
    }
}

function reply (id,username) {
    console.log(id)
    $("#detail-comment-dialog").val("回复"+username+":");
    $("#detail-comment-dialog").focus();
    $("#detail-reply-id").val(id);
}

$(document).ready(function(){
    var mode = "<?php echo ($mode); ?>";
    console.log(mode);
    if(mode == 'detail') {
        showDetail(<?php echo ($detail_id); ?>,0);
    } 
    if(mode == 'login') {
        $('#login').modal('show');
    }

    var $divWidth = 0.7*$('.pc-list img').width();
    $('.pc-list img').css({'height':$divWidth});

    
    var $themeheight= 0.3*document.body.clientWidth;
    $('.pc-theme-img').css({'height':$themeheight});
});

$('#beginsearch').click(function () {
  $("#keyword").val($("#keyword1").val())
  $("#searchf").submit();

});

$('.search').keydown(function(e){
    if(e.keyCode==13){
        $('#beginsearch').trigger('click');
    }
});
</script>
    
    
</body>

</html>